import React, {Component} from 'react';
import cs from 'classnames'
import BaseCmpt from '../BaseCmpt';
import './index.css';
import {Button} from 'antd';

class MButton extends BaseCmpt {

    static defaultProps = {
        data: {
            type: 12,
            style: {},
            dataset: {
                btnText: ''
            }
        }
    };

    constructor(props) {
        super(props);
    }

    render() {
        var {onSelected, selected, data} = this.props;
        var {style, dataset} = data;
        var {btnText} = dataset;

        return (
            <div
                onClick={(e) => {
                    onSelected && onSelected(e)
                }}
                className={cs({'mButton clearfix cmptEle': true, 'cmptEle_selected': selected})}
                style={{...style}}
            >
                <Button className="btn-primary">{btnText || '按钮'}</Button>
            </div>
        );
    }
}

export default MButton;
